package com.droid.mvvmlib.base;

import androidx.databinding.ObservableArrayList;

/**
 *
 * @author zyc0617
 * @since  2019/8/21 23:17
 */
public abstract class BaseOnListenerCallBack<D> extends ObservableArrayList.OnListChangedCallback<ObservableArrayList<D>> {
    @Override
    public void onChanged(ObservableArrayList<D> sender) {

    }

    @Override
    public void onItemRangeChanged(ObservableArrayList<D> sender, int positionStart, int itemCount) {

    }

    @Override
    public void onItemRangeInserted(ObservableArrayList<D> sender, int positionStart, int itemCount) {
        onItemInsert(sender, positionStart, itemCount);
    }

    @Override
    public void onItemRangeMoved(ObservableArrayList<D> sender, int fromPosition, int toPosition, int itemCount) {

    }

    @Override
    public void onItemRangeRemoved(ObservableArrayList<D> sender, int positionStart, int itemCount) {

    }

    protected abstract void onItemInsert(ObservableArrayList<D> sender, int positionStart, int itemCount);
}
